import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import Categories from '@/views/Categories.vue'
import Tags from '@/views/Tags.vue'
import Archives from '@/views/Archives.vue'
import Knowledge from '@/views/Knowledge.vue'
import ArticleDetail from '@/views/ArticleDetail.vue'
import Login from '@/views/Login.vue'

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/articles',
      name: 'articles',
      component: Home
    },
    {
      path: '/articles/:id',
      name: 'article-detail',
      component: ArticleDetail
    },
    {
      path: '/categories',
      name: 'categories',
      component: Categories
    },
    {
      path: '/categories/:categoryId/articles',
      name: 'category-articles',
      component: Home
    },
    {
      path: '/tags',
      name: 'tags',
      component: Tags
    },
    {
      path: '/tags/:tagId/articles',
      name: 'tag-articles',
      component: Home
    },
    {
      path: '/archives',
      name: 'archives',
      component: Archives
    },
    {
      path: '/archives/:year/:month',
      name: 'archive-articles',
      component: Home
    },
    {
      path: '/knowledge',
      name: 'knowledge',
      component: Knowledge
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    }
  ]
})

export default router
